/*
 * @Author: 刘美红 liumeihong@llootong.com
 * @Date: 2025-04-21 18:19:32
 * @LastEditors: 刘美红 liumeihong@llootong.com
 * @LastEditTime: 2025-04-25 11:12:47
 * @FilePath: \xgjd-app\src\api\modules\auth.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request';
import type { ResponseData } from '@/utils/types';
// 登录接口
export interface LoginParams {
  username: string;
  password: string;
  captcha: string;
}

export interface LoginResult {
  token: string;
  userInfo: {
    userId: number;
    username: string;
    avatar: string;
  };
}
export default {
  login(data: any) {
    return request({
      url: '/integrated-workbench/v1/mobileapp/staff/login',
      method: 'POST',
      data,
      showLoading: true,
    });
  },
  getUserInfo() {
    return request({
      url: '/baseapi/user/getYhxx',
      method: 'GET',
    });
  },

  // 退出登录
  logout() {
    return request({
      url: '/mobileapp/staff/logout',
      method: 'POST',
    });
  },
  getToken() {
    return request({
      url: '/auth/logout',
      method: 'POST',
    });
  },
};
